---------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\sbstjp\OneDrive - Cardiff University\FinalHarvard\Appendix2.7.log
  log type:  text
 opened on:  12 May 2025, 16:49:45

. 
. use "C:\Users\sbstjp\OneDrive - Cardiff University\CES24_Common.dta" // Schaffner, Brian; Shih, Marissa; Anso
> labehere, Stephen; Pope, Jeremy, 2025, "Cooperative Election Study Common Content, 2024", https://doi.org/10.
> 7910/DVN/X11EP6, Harvard Dataverse, V3. Accessed on 12 April 2025.

. 
. // Social Justice scale
. rename CC24_321e defund

. rename CC24_444a gendertransition

. rename CC24_444b parentalconsentpronouns 

. rename CC24_445a raceuniadmissions

. 
. *Reverse coding so social justice values are high
. foreach var in defund {
  2.     qui sum `var'
  3.     local max_value = r(max)
  4.     gen r`var' = `max_value' + 1 - `var'
  5. }
(9 missing values generated)

. 
. * Replace missing values with 0 for the specified variables - this is necessary as Stata doesn't add up missi
> ng values and means a 0-1 standardization scale isn't feasible as missing values would overlap with the scale
. foreach var in rdefund parentalconsentpronouns gendertransition raceuniadmissions {
  2.     replace `var' = 0 if missing(`var')
  3. }
(9 real changes made)
(10,577 real changes made)
(10,580 real changes made)
(10,578 real changes made)

. 
. * Initialize the total score and the count of non-zero responses
. gen total_scoreSJV = 0

. gen count_nonzeroSJV = 0

. 
. * Add each variable to the total scale score and count it if non-zero
. foreach var in rdefund parentalconsentpronouns gendertransition raceuniadmissions  {
  2.     replace total_scoreSJV = total_scoreSJV + `var'
  3.     replace count_nonzeroSJV = count_nonzeroSJV + (`var' != 0)
  4. }
(59,991 real changes made)
(59,991 real changes made)
(49,423 real changes made)
(49,423 real changes made)
(49,420 real changes made)
(49,420 real changes made)
(49,422 real changes made)
(49,422 real changes made)

. 
. * Calculate the average score, avoiding division by zero
. gen SocJusValues = .
(60,000 missing values generated)

. replace SocJusValues = total_scoreSJV / count_nonzeroSJV if count_nonzeroSJV > 0
(59,998 real changes made)

. 
. // Demographics
. *Delete missing values and rename
. replace gender4=. if gender4>2
(554 real changes made, 554 to missing)

. rename gender4 FemaleGender

. 
. replace faminc_new=. if faminc_new==97 
(5,119 real changes made, 5,119 to missing)

. 
. generate age = 2024 - birthyr

. 
. replace CC24_330a=. if CC24_330a==8 
(3,043 real changes made, 3,043 to missing)

. rename CC24_330a libconsp

. 
. *Create dummies
. gen Graduate=.
(60,000 missing values generated)

. replace Graduate=0 if inrange(educ, 1, 4)
(38,743 real changes made)

. replace Graduate=1 if inlist(educ, 5, 6)
(21,257 real changes made)

. 
. gen BIPOC=.
(60,000 missing values generated)

. replace BIPOC=0 if race==1
(41,443 real changes made)

. replace BIPOC=1 if inrange(race, 2, 8)
(18,557 real changes made)

. 
. gen SocCulEmployment=.
(60,000 missing values generated)

. replace SocCulEmployment=1 if inlist(industry, 7, 8)
(11,925 real changes made)

. replace SocCulEmployment=0 if inrange(industry, 1, 6)
(12,668 real changes made)

. replace SocCulEmployment=0 if inrange(industry, 9, 17)
(28,061 real changes made)

. 
. // Standardize
. egen Age = std(age)

. egen Income = std(faminc_new)
(5,142 missing values generated)

. 
. // Regressions
. regress SocJusValues Age BIPOC FemaleGender Graduate Income SocCulEmployment [pweight=commonweight], robust
(sum of wgt is 47,127.898269813)

Linear regression                               Number of obs     =     47,878
                                                F(6, 47871)       =     154.09
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0504
                                                Root MSE          =     .34644

----------------------------------------------------------------------------------
                 |               Robust
    SocJusValues | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-----------------+----------------------------------------------------------------
             Age |  -.0599416   .0030281   -19.80   0.000    -.0658767   -.0540065
           BIPOC |   .0363742    .006603     5.51   0.000     .0234321    .0493162
    FemaleGender |   .0234011   .0056722     4.13   0.000     .0122836    .0345187
        Graduate |   .0795233   .0060131    13.22   0.000     .0677374    .0913091
          Income |  -.0043009   .0032432    -1.33   0.185    -.0106576    .0020559
SocCulEmployment |   .0318842   .0066504     4.79   0.000     .0188493    .0449191
           _cons |    1.24922   .0094153   132.68   0.000     1.230766    1.267674
----------------------------------------------------------------------------------

. eststo
(est1 stored)

. regress SocJusValues Age BIPOC FemaleGender Graduate Income SocCulEmployment if libconsp<4 [pweight=commonwei
> ght], robust
(sum of wgt is 14,937.3879525611)

Linear regression                               Number of obs     =     17,792
                                                F(6, 17785)       =      95.76
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0867
                                                Root MSE          =     .32224

----------------------------------------------------------------------------------
                 |               Robust
    SocJusValues | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-----------------+----------------------------------------------------------------
             Age |  -.0480032   .0045215   -10.62   0.000    -.0568658   -.0391406
           BIPOC |  -.1015814   .0100882   -10.07   0.000    -.1213553   -.0818075
    FemaleGender |   .0201845   .0087785     2.30   0.021     .0029778    .0373912
        Graduate |   .1053224   .0098757    10.66   0.000     .0859651    .1246797
          Income |   .0207432   .0048307     4.29   0.000     .0112746    .0302119
SocCulEmployment |   .0210659    .009483     2.22   0.026     .0024783    .0396535
           _cons |    1.53341   .0156955    97.70   0.000     1.502645    1.564174
----------------------------------------------------------------------------------

. eststo
(est2 stored)

. esttab

--------------------------------------------
                      (1)             (2)   
             SocJusValues    SocJusValues   
--------------------------------------------
Age               -0.0599***      -0.0480***
                 (-19.80)        (-10.62)   

BIPOC              0.0364***       -0.102***
                   (5.51)        (-10.07)   

FemaleGender       0.0234***       0.0202*  
                   (4.13)          (2.30)   

Graduate           0.0795***        0.105***
                  (13.22)         (10.66)   

Income           -0.00430          0.0207***
                  (-1.33)          (4.29)   

SocCulEmpl~t       0.0319***       0.0211*  
                   (4.79)          (2.22)   

_cons               1.249***        1.533***
                 (132.68)         (97.70)   
--------------------------------------------
N                   47878           17792   
--------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001

. 
. log close
      name:  <unnamed>
       log:  C:\Users\sbstjp\OneDrive - Cardiff University\FinalHarvard\Appendix2.7.log
  log type:  text
 closed on:  12 May 2025, 16:50:13
---------------------------------------------------------------------------------------------------------------
